package com.gjw.myapp.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

import com.gjw.myapp.R;
import com.gjw.myapp.test.FontActivity;

/**
 * author :  Administrator
 * date   :  2021/7/1/001  15:28
 * e-mail :  JimvenGao@163.com
 * version:  1.0
 * >>>>>>
 * desc   :
 */
public class LaunchActivity extends FragmentActivity {
    private Handler mHandler;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
            finish();
            return;
        }
        mHandler = new Handler();
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                //暂停两秒跳到首页
                Intent intent = new Intent(LaunchActivity.this, FontActivity.class);
                overridePendingTransition(R.anim.screen_zoom_in, R.anim.screen_zoom_out);
                startActivity(intent);
                finish();
            }
        }, 2000);
    }
}
